
package com.oet.persistence.manager;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import javax.persistence.EntityManager;
import com.oet.persistence.entity.*;


import org.springframework.dao.DataAccessException;

/**
 * The high-level ydk business db interface.
 * <p>
 * This is basically a data access object. ydk should add more dedicated
 * business facades.
 *
 * @author Zhang Yu
 */
public interface OetDbMngr {


	
	EntityManager getEntityManager();
	
	/**
	 * Retrieve all <code>Key</code>s from the data store.
	 * @return Collection<Key>
	 * @throws DataAccessException
	 */
	Collection<Key> getAllKeys() throws DataAccessException;
	Collection<Key> getLimitedKeys(Integer maxNumPerPage) throws DataAccessException;

	Collection<Key> findAllKeys(Object searchKey) throws DataAccessException;
	Collection<Key> findLimitedKeys(Object searchKey, Integer maxNumPerPage) throws DataAccessException;
	/**
	 * CRUD
	 */
	Key getKey(Object id) throws DataAccessException;
	Key getKeyByYdkBookId(String ydkBookId) throws DataAccessException;
	void storeKey(Key instance) throws DataAccessException;
	void updateKey(Key instance) throws DataAccessException;
	void deleteKey(Object id) throws DataAccessException;
	
	
	/**
	 * Retrieve all <code>YdkRole</code>s from the data store.
	 * @return Collection<YdkRole>
	 * @throws DataAccessException
	 */
	Collection<MngrRole> getAllYdkRoles() throws DataAccessException;
	Collection<MngrRole> getLimitedYdkRoles(Integer maxNumPerPage) throws DataAccessException;

	Collection<MngrRole> findAllYdkRoles(Object searchKey) throws DataAccessException;
	Collection<MngrRole> findLimitedYdkRoles(Object searchKey, Integer maxNumPerPage) throws DataAccessException;
	/**
	 * CRUD
	 */
	MngrRole getYdkRole(Object id) throws DataAccessException;
	void storeYdkRole(MngrRole instance) throws DataAccessException;
	void updateYdkRole(MngrRole instance) throws DataAccessException;
	void deleteYdkRole(Object id) throws DataAccessException;
	
	/**
	 * Retrieve all <code>YdkAccount</code>s from the data store.
	 * @return Collection<YdkAccount>
	 * @throws DataAccessException
	 */
	Collection<MngrAccount> getAllYdkAccounts() throws DataAccessException;
	Collection<MngrAccount> getLimitedYdkAccounts(Integer maxNumPerPage) throws DataAccessException;

	Collection<MngrAccount> findAllYdkAccounts(Object searchKey) throws DataAccessException;
	Collection<MngrAccount> findLimitedYdkAccounts(Object searchKey, Integer maxNumPerPage) throws DataAccessException;
	/**
	 * CRUD
	 */
	MngrAccount getYdkAccount(Object id) throws DataAccessException;
	MngrAccount getYdkAccountByName(String username) throws DataAccessException;
	void storeYdkAccount(MngrAccount instance) throws DataAccessException;
	void updateYdkAccount(MngrAccount instance) throws DataAccessException;
	void deleteYdkAccount(Object id) throws DataAccessException;
	
	
	/**
	 * 
	 * 
	 * 
	 */
	/**
	 * 
	 * For processing Entity Category
	 * 
	 */
	Collection<Category> getAllCategorys() throws DataAccessException;
	Collection<Category> getCategory(List<Long> ids) throws DataAccessException;
	Collection<Category> getLimitedCategorys(Integer maxNumPerPage) throws DataAccessException;
	Collection<Category> findAllCategorys(Object searchKey) throws DataAccessException;
	List<Category> searchCategory(String name) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	Category getCategory(Object id) throws DataAccessException;
	Category getCategoryByTitle(String title) throws DataAccessException;
	void storeCategory(Category instance) throws DataAccessException;
	void updateCategory(Category instance) throws DataAccessException;
	void deleteCategory(Object id) throws DataAccessException;
	
	
	/**
	 * 
	 * For processing Entity Course
	 * 
	 */
	Collection<Course> getAllCourses() throws DataAccessException;
	Collection<Course> getCourse(List<Long> ids) throws DataAccessException;
	Collection<Course> getLimitedCourses(Integer maxNumPerPage) throws DataAccessException;
	Collection<Course> findAllCourses(Object searchKey) throws DataAccessException;	
	List<Course> searchCourse(CourseSeries courseSeries,
			String name,  Integer chapterId, Integer type, 
			Integer level, Double payFactor, Long teacherId,
			String topic, Integer capacity, Integer occupyNum, Date startDate, Date endDate) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	Course getCourse(Object id) throws DataAccessException;
	Course getCourseByTitle(String title) throws DataAccessException;
	void storeCourse(Course instance) throws DataAccessException;
	void updateCourse(Course instance) throws DataAccessException;
	void deleteCourse(Object id) throws DataAccessException;
	
	
	/**
	 * 
	 * For processing Entity CourseFile
	 * 
	 */
	Collection<CourseFile> getAllCourseFiles() throws DataAccessException;
	Collection<CourseFile> getCourseFile(List<Long> ids) throws DataAccessException;
	Collection<CourseFile> getLimitedCourseFiles(Integer maxNumPerPage) throws DataAccessException;
	Collection<CourseFile> findAllCourseFiles(Object searchKey) throws DataAccessException;
	List<CourseFile> searchCourseFile(
			Long courseId, Long courseSeriesId, String name, Integer type,
			Integer version, Date startDate, Date endDate) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	CourseFile getCourseFile(Object id) throws DataAccessException;
	CourseFile getCourseFileByTitle(String title) throws DataAccessException;
	void storeCourseFile(CourseFile instance) throws DataAccessException;
	void updateCourseFile(CourseFile instance) throws DataAccessException;
	void deleteCourseFile(Object id) throws DataAccessException;
	
	/**
	 * 
	 * For processing Entity CourseNews
	 * 
	 */
	Collection<CourseNews> getAllCourseNewss() throws DataAccessException;
	Collection<CourseNews> getCourseNews(List<Long> ids) throws DataAccessException;
	Collection<CourseNews> getLimitedCourseNewss(Integer maxNumPerPage) throws DataAccessException;
	Collection<CourseNews> findAllCourseNewss(Object searchKey) throws DataAccessException;
	List<CourseNews> searchCourseNews(
			Long courseId, Long courseSeriesId, String name, Integer type,
			Integer version, Date startDate, Date endDate) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	CourseNews getCourseNews(Object id) throws DataAccessException;
	CourseNews getCourseNewsByTitle(String title) throws DataAccessException;
	void storeCourseNews(CourseNews instance) throws DataAccessException;
	void updateCourseNews(CourseNews instance) throws DataAccessException;
	void deleteCourseNews(Object id) throws DataAccessException;
	
	
	/**
	 * 
	 * For processing Entity CourseSeries
	 * 
	 */
	Collection<CourseSeries> getAllCourseSeriess() throws DataAccessException;
	Collection<CourseSeries> getCourseSeries(List<Long> ids) throws DataAccessException;
	Collection<CourseSeries> getLimitedCourseSeriess(Integer maxNumPerPage) throws DataAccessException;
	Collection<CourseSeries> findAllCourseSeriess(Object searchKey) throws DataAccessException;
	List<CourseSeries> searchCourseSeries(
			String name, Category category, 
			Integer level, Integer courseNumber, Teacher teacher,
			Integer capacity, Integer occupyNum, Date startDate, Date endDate, 
			Boolean isActived, Double totalPrice) throws DataAccessException;
	List<CourseSeries> searchCourseSeries(
			String name, Category category, 
			Integer level, Integer courseNumber, Teacher teacher,
			Integer capacity, Integer occupyNum, Date startDate, Date endDate, 
			Boolean isActived, Double totalPrice, 
			Integer weekdayFlagStart, Integer weekdayFlagEnd,
			Integer timeFlag, Boolean isAvailable
			) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	CourseSeries getCourseSeries(Object id) throws DataAccessException;
	CourseSeries getCourseSeriesByTitle(String title) throws DataAccessException;
	void storeCourseSeries(CourseSeries instance) throws DataAccessException;
	void updateCourseSeries(CourseSeries instance) throws DataAccessException;
	void deleteCourseSeries(Object id) throws DataAccessException;
	
	
	/**
	 * 
	 * For processing Entity Customer
	 * 
	 */
	Collection<Customer> getAllCustomers() throws DataAccessException;
	Collection<Customer> getCustomer(List<Long> ids) throws DataAccessException;
	Collection<Customer> getLimitedCustomers(Integer maxNumPerPage) throws DataAccessException;
	Collection<Customer> findAllCustomers(Object searchKey) throws DataAccessException;
	List<Customer> searchCustomer(String name, String email, String mobilePhone, 
			Integer level, Integer couresHours, Boolean isActived, Integer totalCourseNumber,
			Boolean isTestFinished, Long accountId) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	Customer getCustomer(Object id) throws DataAccessException;
	Customer getCustomerByTitle(String title) throws DataAccessException;
	Customer getCustomerByEmail(String title) throws DataAccessException;
	Customer getCustomerByTel(String title) throws DataAccessException;
	void storeCustomer(Customer instance) throws DataAccessException;
	void updateCustomer(Customer instance) throws DataAccessException;
	void deleteCustomer(Object id) throws DataAccessException;
	
	
	/**
	 * 
	 * For processing Entity Teacher
	 * 
	 */
	Collection<Teacher> getAllTeachers() throws DataAccessException;
	Collection<Teacher> getTeacher(List<Long> ids) throws DataAccessException;
	Collection<Teacher> getLimitedTeachers(Integer maxNumPerPage) throws DataAccessException;
	Collection<Teacher> findAllTeachers(Object searchKey) throws DataAccessException;
	List<Teacher> searchTeacher(String name, String email, String mobilePhone, 
			Integer level, Boolean isActived, Integer totalCourseNumber) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	Teacher getTeacher(Object id) throws DataAccessException;
	Teacher getTeacherByTitle(String title) throws DataAccessException;
	void storeTeacher(Teacher instance) throws DataAccessException;
	void updateTeacher(Teacher instance) throws DataAccessException;
	void deleteTeacher(Object id) throws DataAccessException;
	
	/**
	 * 
	 * For processing Entity UserComment
	 * 
	 */
	Collection<UserComment> getAllUserComments() throws DataAccessException;
	Collection<UserComment> getUserComment(List<Long> ids) throws DataAccessException;
	Collection<UserComment> getLimitedUserComments(Integer maxNumPerPage) throws DataAccessException;
	Collection<UserComment> findAllUserComments(Object searchKey) throws DataAccessException;
	List<UserComment> searchUserComment(
			Long courseId, Long courseSeriesId, Long teacherId, 
			String topic, Integer type, Integer level, 
			Date startDate, Date endDate, Customer customer) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	UserComment getUserComment(Object id) throws DataAccessException;
	UserComment getUserCommentByTitle(String title) throws DataAccessException;
	void storeUserComment(UserComment instance) throws DataAccessException;
	void updateUserComment(UserComment instance) throws DataAccessException;
	void deleteUserComment(Object id) throws DataAccessException;
	
	
	/**
	 * 
	 * For processing Entity UserCourseSeries
	 * 
	 */
	Collection<UserCourseSeries> getAllUserCourseSeriess() throws DataAccessException;
	Collection<UserCourseSeries> getUserCourseSeries(List<Long> ids) throws DataAccessException;
	Collection<UserCourseSeries> getLimitedUserCourseSeriess(Integer maxNumPerPage) throws DataAccessException;
	Collection<UserCourseSeries> findAllUserCourseSeriess(Object searchKey) throws DataAccessException;
	List<UserCourseSeries> searchUserCourseSeries(
			Long courseSeriesId, String name,  
			Integer type, Integer level, Long teacherId, String teacherName,Integer capacity,
			Date startDate, Date endDate, Customer customer) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	UserCourseSeries getUserCourseSeries(Object id) throws DataAccessException;
	UserCourseSeries getUserCourseSeriesByTitle(String title) throws DataAccessException;
	void storeUserCourseSeries(UserCourseSeries instance) throws DataAccessException;
	void updateUserCourseSeries(UserCourseSeries instance) throws DataAccessException;
	void deleteUserCourseSeries(Object id) throws DataAccessException;
	
	
	/**
	 * 
	 * For processing Entity UserHistoryCourse
	 * 
	 */
	Collection<UserHistoryCourse> getAllUserHistoryCourses() throws DataAccessException;
	Collection<UserHistoryCourse> getUserHistoryCourse(List<Long> ids) throws DataAccessException;
	Collection<UserHistoryCourse> getLimitedUserHistoryCourses(Integer maxNumPerPage) throws DataAccessException;
	Collection<UserHistoryCourse> findAllUserHistoryCourses(Object searchKey) throws DataAccessException;
	List<UserHistoryCourse> searchUserHistoryCourse(
			Long courseId, Long courseSeriesId, String name,  
			Integer type, Integer level, Double payFactor, Long teacherId, String teacherName,
			String topic, Integer capacity,
			Date startDate, Date endDate, Boolean isCommented,Customer customer) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	UserHistoryCourse getUserHistoryCourse(Object id) throws DataAccessException;
	UserHistoryCourse getUserHistoryCourseByTitle(String title) throws DataAccessException;
	void storeUserHistoryCourse(UserHistoryCourse instance) throws DataAccessException;
	void updateUserHistoryCourse(UserHistoryCourse instance) throws DataAccessException;
	void deleteUserHistoryCourse(Object id) throws DataAccessException;
	
	
	/**
	 * 
	 * For processing Entity UserPlannedCourse
	 * 
	 */
	Collection<UserPlannedCourse> getAllUserPlannedCourses() throws DataAccessException;
	Collection<UserPlannedCourse> getUserPlannedCourse(List<Long> ids) throws DataAccessException;
	Collection<UserPlannedCourse> getLimitedUserPlannedCourses(Integer maxNumPerPage) throws DataAccessException;
	Collection<UserPlannedCourse> findAllUserPlannedCourses(Object searchKey) throws DataAccessException;
	List<UserPlannedCourse> searchUserPlannedCourse(
			Long courseId, Long courseSeriesId, String name,  
			Integer type, Integer level, Double payFactor, Long teacherId, String teacherName,
			String topic, Integer capacity,
			Date startDate, Date endDate, Customer customer) throws DataAccessException;
	
	/**
	 * CRUD
	 */
	UserPlannedCourse getUserPlannedCourse(Object id) throws DataAccessException;
	UserPlannedCourse getUserPlannedCourseByTitle(String title) throws DataAccessException;
	void storeUserPlannedCourse(UserPlannedCourse instance) throws DataAccessException;
	void updateUserPlannedCourse(UserPlannedCourse instance) throws DataAccessException;
	void deleteUserPlannedCourse(Object id) throws DataAccessException;
	
	
	
	
	/**
	 * Example for New Entity
	 */
//	/**
//	 * Retrieve all <code>Channel</code>s from the data store.
//	 * @return Collection<Channel>
//	 * @throws DataAccessException
//	 */
//	Collection<Channel> getAllChannels() throws DataAccessException;
//	Collection<Channel> getChannel(List<Long> ids) throws DataAccessException;
//	Collection<Channel> getLimitedChannels(Integer maxNumPerPage) throws DataAccessException;
//	Collection<Channel> findAllChannels(Object searchKey) throws DataAccessException;
//	List<Channel> searchChannel(String title, Integer category, Integer type, Long parentId) throws DataAccessException;
//	
//	/**
//	 * CRUD
//	 */
//	Channel getChannel(Object id) throws DataAccessException;
//	Channel getChannelByTitle(String title) throws DataAccessException;
//	void storeChannel(Channel instance) throws DataAccessException;
//	void updateChannel(Channel instance) throws DataAccessException;
//	void deleteChannel(Object id) throws DataAccessException;
	
	
	
}
